const { Tab } = require('../../assets/libs/zanui/index');

var app = getApp();
Page(Object.assign({}, Tab, {
  data: {
		cdnUrl: '',
		isHidden: true,
		code: 1, //成功与失败控制按钮
		msg: '',
		orderDetail: {
			code: '',
			shopproduct: {
				shopstore: {
					name: '',
					address: ''
				}
			}
		},//兑换信息
		/* 自定义导航栏参数 */
		loading: false,
		color: '#FFFFFF',
		background: '#FFFFFF',
		show: true,
		animated: false,
		back: true,
		title: "兑换结果"
  },
  onLoad: function (e) {
		var code = e.code;
		var msg  = e.msg;
		var id  = e.id;
    var that = this;
		// app.showLoginModal(e);
		that.setData({
			cdnUrl: app.cdnUrl,
			code: code,
			msg: msg
		});
		if(id>0){
			that.orderDetail(id);
		}
  },
	/* 获取商品信息 */
	orderDetail: function(id){
		var that = this;
		app.request('/addons/cms/wxapp.shop/orderDetail', {id: id}, function (data, ret) {//获取地址信息
		  that.setData({
				orderDetail: data
		  });
		}, function (data, ret) {});
		
	},
  onShareAppMessage: function () {
    return {
      title: '',
      desc: '',
      path: '/page/index/index'
    }
  },
  
  /* 弹窗 */
  showMd: function(e) {
      var that = this;
      // var id = e.currentTarget.dataset.id - 1;
      this.setData({
          isHidden: false,//显示模态框，
          // indexModel: that.data.modelList[id],
      })
  },
  hiddenMd: function() {
      this.setData({
          isHidden: true//隐藏模态框
      })
  },
}))
